const http = require('http');
const express = require('express');
const ParseServer = require('parse-server').ParseServer;
const ParseDashboard = require('parse-dashboard');
const Config = require('../config');

const api = new ParseServer(Config.server);
const dashboard = new ParseDashboard(Config.dashboard);

let app = express();

app.use(Config.serverPath, api);
app.use(Config.dashboardPath, dashboard);

const port = Config.port;
const httpServer = http.createServer(app);
httpServer.listen(port, () => {
    console.log(`parse-server-dashboard server start, running on port: ${port}`);
});